package com.nlp.trie.tel;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

public final class TrieNode {
	
	//protected TrieNode[] children;//孩子节点
	protected Map<Character, TrieNode> children;
	protected char splitChar;//节点字符
	protected String area;//存储区位信息

	/**
	 * 构造方法
	 * @param splitChar
	 */
	protected TrieNode(char splitChar) {
		children = new HashMap<Character, TrieNode>();
		area = null;
		this.splitChar = splitChar;
	}
	
	public String getPath(ArrayList<TrieNode> parentNodes) {
		StringBuilder sb = new StringBuilder();
		for (TrieNode p : parentNodes) {
			sb.append(p.splitChar);
		}
		sb.append(this.splitChar);
		return sb.toString();
	}
}
